import _fetch from './request.js'

// 获取搜索结果
function search (params) {
  return _fetch({
    url: '/app/v1_0/search',
    params
  })
}
// 获取联想建议
function suggestion (params) {
  return _fetch({
    url: '/app/v1_0/suggestion',
    params
  })
}
// 获取用户搜索历史
function searchHistories () {
  return _fetch({
    url: '/app/v1_0/search/histories',
    needToken: true
  })
}
// 删除用户搜索历史
function delSearchHistories () {
  return _fetch({
    url: '/app/v1_0/search/histories',
    needToken: true,
    method: 'delete'
  })
}
export { search, suggestion, searchHistories, delSearchHistories }
